<template>
  <base-dialog v-bind="$attrs" v-on="$listeners" :size="size"  no-button>
    <div class="main">
        <div class="left">
          <slot></slot>
        </div>
        <div class="right"><slot name="right"></slot></div>
    </div>
  </base-dialog>
</template>
<script>
    import eventBus from "@/utils/eventBus";
    import BaseDialog from '../../Common/BaseDialog'
    export default {
        name:"DetailDialogPanel",
      props:{
        size:{
          type:String,
          default:"large"
        }
      },
      components: { BaseDialog },
        created() {
            eventBus.$on("closeDetailDialog", (isReload) => {
                this.handleClose(isReload)
            });
        },
        data(){
            return{
            }
        },
        methods:{
            toClose(){
                this.handleClose(true)
            },
            handleClose(isReload) {
                this.$emit("update:visible", false)
                if(isReload)this.$emit("reloadList")
            },
        },
        beforeDestroy() {
            eventBus.$off("closeDetailDialog")
        }
    }
</script>
